package com.binfenhulian.chinaenergy.ces.manage.framework.config;

import com.binfenhulian.chinaenergy.ces.utils.date.DateUtil;
import org.springframework.core.convert.converter.Converter;

import java.text.ParseException;
import java.util.Date;

/**
 * Created by wanghjbuf on 2018/3/8.
 */
public class StringToDateConveter implements Converter<String,Date> {

    @Override
    public Date convert(String input) {
        try {
            return DateUtil.parseDateByDefaultFormat(input);
        } catch (ParseException e) {
            return null;
        }
    }
}
